import * as THREE from "three"

import World from '../world/world';
import { getMaterials } from '../utils/utils'
export default class gltf {
    static mattress = (world: World) => {
        // 从模型中获取材料和节点对象，并添加至模型对象上
        const gltf = world.assest['mattress.glb'];
        gltf.scene.scale.set(0.03, 0.03, 0.03);
        gltf.scene.position.set(0, -1, 0);
        gltf.scene.rotation.set(0, 0, 0);
        gltf.scene.castShadow = true;
        gltf.scene.traverse((child) => {
            child.castShadow = true; // 根据需要设置，如果你不想让某些网格投射阴影，就设置为false
            child.receiveShadow = false; // 设置为true以接收阴影
        });
        return gltf.scene;
    }

    static xbot = (world: World) => {
        // 从模型中获取材料和节点对象，并添加至模型对象上
        const gltf = world.assest['Xbot.glb'];
        gltf.scene.scale.set(1, 1, 1);
        gltf.scene.position.set(0, -1, 0);
        gltf.scene.rotation.set(0, 0, 0);
        gltf.scene.castShadow = true;
        gltf.scene.traverse((child) => {
            child.castShadow = true; // 根据需要设置，如果你不想让某些网格投射阴影，就设置为false
            child.receiveShadow = false; // 设置为true以接收阴影
        });
        return gltf;
    }
} 